<?php
	include "layout.php";
	
	head("New Planet");
?>
<h1>Create a New Planet</h1>
<?php 
	if (isset($_POST["submit"])) {
		add_planet();
	}
?>
<form name="addplanet" action="addplanet.php" method="post" onsubmit="return validatePlanetForm()">
	<label for="name">Planet Name:</label>
	<input type="text" name="name" placeholder="Planet Name" /><br />
	<label for="size">Planet Size:</label>
	<select name="size">
		<option value=0>--</option>
		<?php 
			for ($i = 1; $i <= 30; $i++) {
				echo "<option value={$i}>{$i}</option>";
			}
		?>
	</select><br />
	<input type="submit" name="submit" value="Create" /> 
</form>
<?php 
	foot();
?>